﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using GraphProcessor;
using System.Linq;
using IQIGame.Onigao.GamePlay;
using IQIGame.Onigao.Logic;

namespace IQIGame.Onigao.GamePlay.Editors
{
    public class SkillTriggerNode : BaseNode
    {
        [Input("优先级"), ShowAsDrawer] public int priority = 1;
        [Output(name = "触发")] public SkillEditorCondition Output;
        
        protected virtual ESkillTriggerType type { get; }

        protected override void Process()
        {
            base.Process();
            this.Output = new SkillEditorCondition()
            {
                trigger = new TriggerConfig()
                {
                    type = (int)this.type,
                    priority = this.priority,
                    customConfig = this.CreateConfig(),
                },
            };

            SkillEditorBlackboard.Instance.AddTrigger(this.Output.trigger);
        }

        protected virtual SkillCustomConfig CreateConfig()
        {
            return null;
        }
    }
}